import path from "path";
import fsExtra from 'fs-extra';
import dayjs from "dayjs";
import {installPostMessage} from './index.js'

export class Task {
  constructor(config) {
    this.entranceUrl = config.url;
    this.config = config;
    // this.taskId = dayjs().format('YYYYMMDD-HH_mm_ss');
    this.taskId = dayjs().valueOf();
    fsExtra.ensureDirSync(path.join(__dirname, `../../static/result/${this.taskId}`));
    
    installPostMessage(this);
    this.postMessage('任务创建成功', this.taskId);
  }
  
  async run() {
  
  }
  
}